#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import plan_blueprint
from api_1_0.planResource.planResource import PlanResource
from api_1_0.planResource.planOtherResource import PlanOtherResource

api = Api(plan_blueprint)

api.add_resource(PlanResource, '/<plan_id>', '', endpoint='Plan')


@plan_blueprint.route('/update/<plan_id>', methods=['PUT'], endpoint='PlanUpdate')
def update(plan_id):
    return PlanOtherResource.sensitive_update(plan_id)

# 保存学习计划
@plan_blueprint.route('/save', methods=['POST'], endpoint='PlanSave')
def save_plan():
    return PlanOtherResource.save_plan()

# 保存学习计划
@plan_blueprint.route('/delete', methods=['POST'], endpoint='PlanDelete')
def delete_plan():
    return PlanOtherResource.delete_plan()